/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.thienloc.omap.controller;

import com.thienloc.omap.entity.TinhThanh;
import com.thienloc.omap.session.TinhThanhFacade;
import java.io.Serializable;
import java.util.List;
import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 *
 * @author GiangLT
 */
@ManagedBean
@RequestScoped
public class ProvinceBean extends BaseBean implements Serializable {

    @EJB
    private TinhThanhFacade facade;
    private final Logger logger = LoggerFactory.getLogger(ProvinceBean.class);

    public ProvinceBean() {
    }

    public List<TinhThanh> getProvincesList() {
        try {
            return facade.findAll();
        } catch (Exception ex) {
            logger.error("[{}]: ", getUsername(), ex);
            return null;
        }
    }
}
